﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using WEB = System.Web;
using System.Collections.Specialized;

namespace Cymbi.Web
{
    public enum MachCollectionType
    {
        QueryString,
        Form
    }

    public class HttpMachRequest
        : WEB.HttpRequestBase
    {
        #region field variables
        private NameValueCollection oQueryString;
        private NameValueCollection oFormCollection;
        #endregion

        public HttpMachRequest()
        {
        }

        #region properties
        public override string this[string key]
        {
            get
            {
                string result = null;

                if (result == null && QueryString != null)
                {
                    result = QueryString[key];
                }
                if (result == null && Form != null)
                {
                    result = Form[key];
                }

                return result;
            }
        }

        public override NameValueCollection QueryString
        {
            get
            {
                return oQueryString;
            }
        }

        public override NameValueCollection Form
        {
            get
            {
                return oFormCollection;
            }
        }
        #endregion

        internal void SetQueryStringCollection(NameValueCollection pCollection)
        {
            oQueryString = pCollection;
        }

        internal void SetFormCollection(NameValueCollection pCollection)
        {
            oFormCollection = pCollection;
        }
    }
}
